home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / TrackObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  12.9 KB  |  327 lines  |  [TEXT/KAHL]

  1. /* TrackObject.h */
  2.  
  3. #ifndef Included_TrackObject_h
  4. #define Included_TrackObject_h
  5.  
  6. /* TrackObject module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* TrackWindow */
  12. /* TrackList */
  13. /* Memory */
  14. /* DataMunging */
  15. /* Array */
  16. /* FrameObject */
  17. /* Screen */
  18. /* TrackView */
  19. /* NoteObject */
  20. /* Menus */
  21. /* MainWindowStuff */
  22. /* BufferedFileInput */
  23. /* BufferedFileOutput */
  24. /* BinaryCodedDecimal */
  25. /* LoadSaveNoteVectors */
  26.  
  27. #include "MainWindowStuff.h"
  28.  
  29. struct TrackObjectRec;
  30. typedef struct TrackObjectRec TrackObjectRec;
  31.  
  32. /* forward declarations */
  33. struct CodeCenterRec;
  34. struct MainWindowRec;
  35. struct TrackListRec;
  36. struct FrameObjectRec;
  37. struct ArrayRec;
  38. struct TrackViewRec;
  39. struct MenuItemType;
  40. struct NoteObjectRec;
  41. struct BufferedInputRec;
  42. struct BufferedOutputRec;
  43.  
  44. /* create a new empty track object */
  45. TrackObjectRec*                NewTrackObject(struct CodeCenterRec* CodeCenter,
  46.                                                 struct MainWindowRec* MainWindow, struct TrackListRec* TrackList);
  47.  
  48. /* dispose of track object and all the crud it contains */
  49. void                                    DisposeTrackObject(TrackObjectRec* TrackObj);
  50.  
  51. /* find out if the object has been changed */
  52. MyBoolean                            HasTrackObjectBeenModified(TrackObjectRec* TrackObj);
  53.  
  54. /* get a copy of the object's name */
  55. char*                                    TrackObjectGetNameCopy(TrackObjectRec* TrackObj);
  56.  
  57. /* put a new name.  the object becomes the owner of the name block, so the */
  58. /* caller should not release it */
  59. void                                    TrackObjectPutName(TrackObjectRec* TrackObj, char* Name);
  60.  
  61. /* get a copy of the name of the instrument that the track will be played with */
  62. char*                                    TrackObjectGetInstrName(TrackObjectRec* TrackObj);
  63.  
  64. /* change the name of the instrument that the track will be played with.  the */
  65. /* track object will become the owner of the block of memory. */
  66. void                                    TrackObjectPutNewInstrName(TrackObjectRec* TrackObj, char* Name);
  67.  
  68. /* get a copy of the postprocessing formula */
  69. char*                                    TrackObjectGetPostProcessing(TrackObjectRec* TrackObj);
  70.  
  71. /* change the postprocessing formula.  the object becomes owner of the memory block. */
  72. void                                    TrackObjectPutNewPostProcessing(TrackObjectRec* TrackObj,
  73.                                                 char* PostProcExpr);
  74.  
  75. /* get number of frames in track */
  76. long                                    TrackObjectGetNumFrames(TrackObjectRec* TrackObj);
  77.  
  78. /* get the frame for a given track index */
  79. struct FrameObjectRec*    TrackObjectGetFrame(TrackObjectRec* TrackObj, long Index);
  80.  
  81. /* delete a range of frames from the track. */
  82. void                                    TrackObjectDeleteFrameRun(TrackObjectRec* TrackObj,
  83.                                                 long Index, long Count);
  84.  
  85. /* get a list of frames and copy them out of the track */
  86. struct ArrayRec*            TrackObjectCopyFrameRun(TrackObjectRec* TrackObj,
  87.                                                 long Index, long Count);
  88.  
  89. /* find any notes that are referencing the specified note via a tie and nullify the tie. */
  90. void                                    TrackObjectNullifyTies(TrackObjectRec* TrackObj,
  91.                                                 struct NoteObjectRec* NoteThatIsDying);
  92.  
  93. /* insert a frame at the specified position */
  94. MyBoolean                            TrackObjectInsertFrame(TrackObjectRec* TrackObj, long Index,
  95.                                                 struct FrameObjectRec* NewFrame);
  96.  
  97. /* show the window for this object.  returns True if successful */
  98. MyBoolean                            TrackObjectOpenWindow(TrackObjectRec* TrackObj);
  99.  
  100. /* notify the object that it's window is closing.  the object should take no action */
  101. void                                    TrackObjectClosingWindowNotify(TrackObjectRec* TrackObj,
  102.                                                 short NewX, short NewY, short NewWidth, short NewHeight);
  103.  
  104. /* indicate that the track has been altered starting at a certain position */
  105. /* this sends a message to all track views that have been registered. */
  106. void                                    TrackObjectAltered(TrackObjectRec* TrackObj, long Index);
  107.  
  108. /* add a track view object to the list of things that want to be notified when */
  109. /* data in this track is altered */
  110. MyBoolean                            TrackObjectAddDependentView(TrackObjectRec* TrackObj,
  111.                                                 struct TrackViewRec* TheView);
  112.  
  113. /* remove a track view object that no longer wants to be notified upon changes */
  114. void                                    TrackObjectRemoveDependentView(TrackObjectRec* TrackObj,
  115.                                                 struct TrackViewRec* TheView);
  116.  
  117. /* add a track view that wants to be seen in the background of this one. */
  118. /* this doesn't actually do too much, since we only keep the list, we don't */
  119. /* do any of the stuff required to actually show it in the background. */
  120. MyBoolean                            TrackObjectAddBackgroundObj(TrackObjectRec* TrackObj,
  121.                                                 TrackObjectRec* OtherTrackObj);
  122.  
  123. /* remove a track view that no longer wants to be seen in the background of this one */
  124. /* the list should call this on everyone when one is deleted so that there aren't */
  125. /* any dangling dependencies left around.  it is not an error to delete something */
  126. /* that isn't in the list */
  127. /* this doesn't actually do too much, since we only keep the list, we don't */
  128. /* do any of the stuff required to actually show it in the background. */
  129. void                                    TrackObjectRemoveBackgroundObj(TrackObjectRec* TrackObj,
  130.                                                 TrackObjectRec* OtherTrackObj);
  131.  
  132. /* get background object list.  (Actual thing). List of TrackObjectRec*'s */
  133. struct ArrayRec*            TrackObjectGetBackgroundList(TrackObjectRec* TrackObj);
  134.  
  135. /* get the menu item associated with this track */
  136. struct MenuItemType*    TrackObjectGetMenuItem(TrackObjectRec* TrackObj);
  137.  
  138. /* the document's name changed, so we need to update the window */
  139. void                                    TrackObjectGlobalNameChange(TrackObjectRec* TrackObj,
  140.                                                 char* NewFilename);
  141.  
  142.  
  143. /* get the default early/late hit adjustment factor */
  144. double                                TrackObjectGetEarlyLateAdjust(TrackObjectRec* TrackObj);
  145.  
  146. /* get the default first release point */
  147. double                                TrackObjectGetReleasePoint1(TrackObjectRec* TrackObj);
  148.  
  149. /* get the default first release point's from start or end flag (this is the same */
  150. /* as the mask used in each note) */
  151. unsigned long                    TrackObjectGetReleasePoint1StartEndFlag(TrackObjectRec* TrackObj);
  152.  
  153. /* get the default second release point */
  154. double                                TrackObjectGetReleasePoint2(TrackObjectRec* TrackObj);
  155.  
  156. /* get the default second release point's from start or end flag */
  157. unsigned long                    TrackObjectGetReleasePoint2StartEndFlag(TrackObjectRec* TrackObj);
  158.  
  159. /* get the default overall loudness adjustment factor */
  160. double                                TrackObjectGetOverallLoudness(TrackObjectRec* TrackObj);
  161.  
  162. /* get the default stereo positioning */
  163. double                                TrackObjectGetStereoPositioning(TrackObjectRec* TrackObj);
  164.  
  165. /* get the default surround positioning */
  166. double                                TrackObjectGetSurroundPositioning(TrackObjectRec* TrackObj);
  167.  
  168. /* get the default first accent adjust */
  169. double                                TrackObjectGetAccent1(TrackObjectRec* TrackObj);
  170.  
  171. /* get the default second accent adjust */
  172. double                                TrackObjectGetAccent2(TrackObjectRec* TrackObj);
  173.  
  174. /* get the default third accent adjust */
  175. double                                TrackObjectGetAccent3(TrackObjectRec* TrackObj);
  176.  
  177. /* get the default fourth accent adjust */
  178. double                                TrackObjectGetAccent4(TrackObjectRec* TrackObj);
  179.  
  180. /* get the default pitch displacement depth adjust */
  181. double                                TrackObjectGetPitchDisplacementDepthAdjust(TrackObjectRec* TrackObj);
  182.  
  183. /* get the default pitch displacement depth control flag */
  184. unsigned long                    TrackObjectGetPitchDisplacementDepthControlFlag(
  185.                                                 TrackObjectRec* TrackObj);
  186.  
  187. /* get the default pitch displacement rate adjust */
  188. double                                TrackObjectGetPitchDisplacementRateAdjust(TrackObjectRec* TrackObj);
  189.  
  190. /* get the default pitch displacement start point */
  191. double                                TrackObjectGetPitchDisplacementStartPoint(TrackObjectRec* TrackObj);
  192.  
  193. /* get the default pitch displacement start point control flag */
  194. unsigned long                    TrackObjectGetPitchDisplacementFromStartOrEnd(
  195.                                                 TrackObjectRec* TrackObj);
  196.  
  197. /* get the default hurry-up factor */
  198. double                                TrackObjectGetHurryUp(TrackObjectRec* TrackObj);
  199.  
  200. /* get the default detuning */
  201. double                                TrackObjectGetDetune(TrackObjectRec* TrackObj);
  202.  
  203. /* get the detuning control flag */
  204. unsigned long                    TrackObjectGetDetuneControlFlag(TrackObjectRec* TrackObj);
  205.  
  206. /* get the default duration adjustment */
  207. double                                TrackObjectGetDurationAdjust(TrackObjectRec* TrackObj);
  208.  
  209. /* get the default duration adjust mode flag */
  210. unsigned long                    TrackObjectGetDurationModeFlag(TrackObjectRec* TrackObj);
  211.  
  212.  
  213. /* change the default early/late hit adjustment factor */
  214. void                                    PutTrackObjectEarlyLateAdjust(TrackObjectRec* TrackObj,
  215.                                                 double NewEarlyLateAdjust);
  216.  
  217. /* change the default first release point */
  218. void                                    PutTrackObjectReleasePoint1(TrackObjectRec* TrackObj,
  219.                                                 double NewReleasePoint1);
  220.  
  221. /* change the default first release point's from start or end flag */
  222. void                                    PutTrackObjectReleasePoint1StartEndFlag(TrackObjectRec* TrackObj,
  223.                                                 unsigned long NewReleasePoint1Flag);
  224.  
  225. /* change the default second release point */
  226. void                                    PutTrackObjectReleasePoint2(TrackObjectRec* TrackObj,
  227.                                                 double NewReleasePoint2);
  228.  
  229. /* change the default second release point's from start or end flag */
  230. void                                    PutTrackObjectReleasePoint2StartEndFlag(TrackObjectRec* TrackObj,
  231.                                                 unsigned long NewReleasePoint2Flag);
  232.  
  233. /* change the default overall loudness adjustment factor */
  234. void                                    PutTrackObjectOverallLoudness(TrackObjectRec* TrackObj,
  235.                                                 double NewOverallLoudness);
  236.  
  237. /* change the default stereo positioning value */
  238. void                                    PutTrackObjectStereoPositioning(TrackObjectRec* TrackObj,
  239.                                                 double NewStereoPositioning);
  240.  
  241. /* change the default surround positioning value */
  242. void                                    PutTrackObjectSurroundPositioning(TrackObjectRec* TrackObj,
  243.                                                 double NewSurroundPositioning);
  244.  
  245. /* change the default first accent adjust */
  246. void                                    PutTrackObjectAccent1(TrackObjectRec* TrackObj,
  247.                                                 double NewAccent1);
  248.  
  249. /* change the default second accent adjust */
  250. void                                    PutTrackObjectAccent2(TrackObjectRec* TrackObj,
  251.                                                 double NewAccent2);
  252.  
  253. /* change the default third accent adjust */
  254. void                                    PutTrackObjectAccent3(TrackObjectRec* TrackObj,
  255.                                                 double NewAccent3);
  256.  
  257. /* change the default fourth accent adjust */
  258. void                                    PutTrackObjectAccent4(TrackObjectRec* TrackObj,
  259.                                                 double NewAccent4);
  260.  
  261. /* change the default pitch displacement depth adjust */
  262. void                                    PutTrackObjectPitchDisplacementDepthAdjust(TrackObjectRec* TrackObj,
  263.                                                 double NewPitchDisplacementDepthAdjust);
  264.  
  265. /* change the default pitch displacement depth control flag */
  266. void                                    PutTrackObjectPitchDisplacementDepthControlFlag(TrackObjectRec*
  267.                                                 TrackObj, unsigned long NewPitchDisplacementDepthControlFlag);
  268.  
  269. /* change the default pitch displacement rate adjust */
  270. void                                    PutTrackObjectPitchDisplacementRateAdjust(TrackObjectRec* TrackObj,
  271.                                                 double NewPitchDisplacementRate);
  272.  
  273. /* change the default pitch displacement start point */
  274. void                                    PutTrackObjectPitchDisplacementStartPoint(TrackObjectRec* TrackObj,
  275.                                                 double NewPitchDisplacementStartPoint);
  276.  
  277. /* change the default pitch displacement start point control flag */
  278. void                                    PutTrackObjectPitchDisplacementFromStartOrEnd(TrackObjectRec*
  279.                                                 TrackObj, unsigned long NewPitchDisplacementStartPointControl);
  280.  
  281. /* change the default hurry-up factor */
  282. void                                    PutTrackObjectHurryUp(TrackObjectRec* TrackObj, double NewHurryUp);
  283.  
  284. /* change the default detuning */
  285. void                                    PutTrackObjectDetune(TrackObjectRec* TrackObj, double NewDetune);
  286.  
  287. /* change the detuning control flag */
  288. void                                    PutTrackObjectDetuneControlFlag(TrackObjectRec* TrackObj,
  289.                                                 unsigned long NewDetuneControlFlag);
  290.  
  291. /* change the default duration adjustment */
  292. void                                    PutTrackObjectDurationAdjust(TrackObjectRec* TrackObj,
  293.                                                 double NewDurationAdjust);
  294.  
  295. /* change the default duration adjust mode flag */
  296. void                                    PutTrackObjectDurationModeFlag(TrackObjectRec* TrackObj,
  297.                                                 unsigned long NewDurationModeFlag);
  298.  
  299. /* find out if this track should be included when we play the score */
  300. MyBoolean                            TrackObjectShouldItBePlayed(TrackObjectRec* TrackObj);
  301.  
  302. /* chage status of whether track should be played */
  303. void                                    ChangeTrackObjectShouldBePlayed(TrackObjectRec* TrackObj,
  304.                                                 MyBoolean ShouldWePlayIt);
  305.  
  306. /* read track information from the file and create a new track object */
  307. FileLoadingErrors            TrackObjectNewFromFile(TrackObjectRec** ObjectOut,
  308.                                                 struct BufferedInputRec* Input, struct CodeCenterRec* CodeCenter,
  309.                                                 struct MainWindowRec* MainWindow, struct TrackListRec* TrackList);
  310.  
  311. /* write the track information to the file. */
  312. FileLoadingErrors            TrackObjectWriteDataOut(TrackObjectRec* TrackObj,
  313.                                                 struct BufferedOutputRec* Output);
  314.  
  315. /* mark track object as saved */
  316. void                                    TrackObjectMarkAsSaved(TrackObjectRec* TrackObj);
  317.  
  318. /* make the track object write out the note array to the file */
  319. MyBoolean                            TrackObjectWriteNotesOutToFile(TrackObjectRec* TrackObj,
  320.                                                 struct BufferedOutputRec* Output);
  321.  
  322. /* load notes from the file & replace track's notes with them */
  323. MyBoolean                            TrackObjectRecoverNotesFromFile(TrackObjectRec* TrackObj,
  324.                                                 struct BufferedInputRec* Input);
  325.  
  326. #endif
  327.